package com.gnerv.rabbitmq.agent.handler;

import com.gnerv.rabbitmq.agent.tools.ExecTools;

/**
 * @author Gnerv LiGen
 */
public class PingExecResultHandler {

    private static final String SUCCEEDED = "succeeded";

    public static boolean handle(ExecTools.ExecResult execResult) {
        int status = execResult.getStatus();
        if (status == 0) {
            String stdout = execResult.getStdout();
            return stdout.contains(SUCCEEDED);
        }
        return false;
    }

}
